\(\int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx\) [53]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 28, antiderivative size = 120 \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {a^2 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {b^2 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {2 a b \sec ^3(c+d x)}{3 d}+\frac {a^2 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {b^2 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d} \]

[Out]

1/2*a^2*arctanh(sin(d*x+c))/d-1/8*b^2*arctanh(sin(d*x+c))/d+2/3*a*b*sec(d*x+c)^3/d+1/2*a^2*sec(d*x+c)*tan(d*x+
c)/d-1/8*b^2*sec(d*x+c)*tan(d*x+c)/d+1/4*b^2*sec(d*x+c)^3*tan(d*x+c)/d

Rubi [A] (verified)

Time = 0.18 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3169, 3853, 3855, 2686, 30, 2691} \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {a^2 \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^2 \tan (c+d x) \sec (c+d x)}{2 d}+\frac {2 a b \sec ^3(c+d x)}{3 d}-\frac {b^2 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {b^2 \tan (c+d x) \sec ^3(c+d x)}{4 d}-\frac {b^2 \tan (c+d x) \sec (c+d x)}{8 d} \]

[In]

Int[Sec[c + d*x]^5*(a*Cos[c + d*x] + b*Sin[c + d*x])^2,x]

[Out]

(a^2*ArcTanh[Sin[c + d*x]])/(2*d) - (b^2*ArcTanh[Sin[c + d*x]])/(8*d) + (2*a*b*Sec[c + d*x]^3)/(3*d) + (a^2*Se
c[c + d*x]*Tan[c + d*x])/(2*d) - (b^2*Sec[c + d*x]*Tan[c + d*x])/(8*d) + (b^2*Sec[c + d*x]^3*Tan[c + d*x])/(4*
d)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 3169

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_.), x_Sym
bol] :> Int[ExpandTrig[cos[c + d*x]^m*(a*cos[c + d*x] + b*sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d}, x] &&
 IntegerQ[m] && IGtQ[n, 0]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \int \left (a^2 \sec ^3(c+d x)+2 a b \sec ^3(c+d x) \tan (c+d x)+b^2 \sec ^3(c+d x) \tan ^2(c+d x)\right ) \, dx \\ & = a^2 \int \sec ^3(c+d x) \, dx+(2 a b) \int \sec ^3(c+d x) \tan (c+d x) \, dx+b^2 \int \sec ^3(c+d x) \tan ^2(c+d x) \, dx \\ & = \frac {a^2 \sec (c+d x) \tan (c+d x)}{2 d}+\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{2} a^2 \int \sec (c+d x) \, dx-\frac {1}{4} b^2 \int \sec ^3(c+d x) \, dx+\frac {(2 a b) \text {Subst}\left (\int x^2 \, dx,x,\sec (c+d x)\right )}{d} \\ & = \frac {a^2 \text {arctanh}(\sin (c+d x))}{2 d}+\frac {2 a b \sec ^3(c+d x)}{3 d}+\frac {a^2 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {b^2 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac {1}{8} b^2 \int \sec (c+d x) \, dx \\ & = \frac {a^2 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {b^2 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {2 a b \sec ^3(c+d x)}{3 d}+\frac {a^2 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {b^2 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00 \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {a^2 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {b^2 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {2 a b \sec ^3(c+d x)}{3 d}+\frac {a^2 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {b^2 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d} \]

[In]

Integrate[Sec[c + d*x]^5*(a*Cos[c + d*x] + b*Sin[c + d*x])^2,x]

[Out]

(a^2*ArcTanh[Sin[c + d*x]])/(2*d) - (b^2*ArcTanh[Sin[c + d*x]])/(8*d) + (2*a*b*Sec[c + d*x]^3)/(3*d) + (a^2*Se
c[c + d*x]*Tan[c + d*x])/(2*d) - (b^2*Sec[c + d*x]*Tan[c + d*x])/(8*d) + (b^2*Sec[c + d*x]^3*Tan[c + d*x])/(4*
d)

Maple [A] (verified)

Time = 1.15 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.98

method result size
derivativedivides \(\frac {a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {2 a b}{3 \cos \left (d x +c \right )^{3}}+b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(118\)
default \(\frac {a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {2 a b}{3 \cos \left (d x +c \right )^{3}}+b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(118\)
parts \(\frac {a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}+\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}+\frac {2 a b \sec \left (d x +c \right )^{3}}{3 d}\) \(123\)
parallelrisch \(\frac {-48 \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \left (a -\frac {b}{2}\right ) \left (a +\frac {b}{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+48 \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \left (a -\frac {b}{2}\right ) \left (a +\frac {b}{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+64 a b \cos \left (2 d x +2 c \right )+16 a b \cos \left (4 d x +4 c \right )+\left (24 a^{2}-6 b^{2}\right ) \sin \left (3 d x +3 c \right )+\left (24 a^{2}+42 b^{2}\right ) \sin \left (d x +c \right )+128 b a \left (\cos \left (d x +c \right )+\frac {3}{8}\right )}{24 d \left (3+\cos \left (4 d x +4 c \right )+4 \cos \left (2 d x +2 c \right )\right )}\) \(200\)
risch \(-\frac {i {\mathrm e}^{i \left (d x +c \right )} \left (12 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}-3 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+12 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+21 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+64 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-12 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-21 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+64 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}-12 a^{2}+3 b^{2}\right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {\ln \left (i+{\mathrm e}^{i \left (d x +c \right )}\right ) a^{2}}{2 d}-\frac {b^{2} \ln \left (i+{\mathrm e}^{i \left (d x +c \right )}\right )}{8 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{2 d}+\frac {b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}\) \(255\)
norman \(\frac {\frac {4 a b}{3 d}-\frac {\left (4 a^{2}-11 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{2 d}-\frac {\left (4 a^{2}-11 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{2 d}+\frac {\left (4 a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (4 a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{4 d}+\frac {\left (4 a^{2}+9 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{4 d}+\frac {\left (4 a^{2}+9 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{4 d}+\frac {4 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{3 d}-\frac {4 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}}{d}+\frac {8 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{3 d}-\frac {4 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{d}+\frac {8 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{3 d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{4} \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}-\frac {\left (4 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {\left (4 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) \(343\)

[In]

int(sec(d*x+c)^5*(cos(d*x+c)*a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^2*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))+2/3*a*b/cos(d*x+c)^3+b^2*(1/4*sin(d*x+c)^3/
cos(d*x+c)^4+1/8*sin(d*x+c)^3/cos(d*x+c)^2+1/8*sin(d*x+c)-1/8*ln(sec(d*x+c)+tan(d*x+c))))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00 \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {3 \, {\left (4 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (4 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 32 \, a b \cos \left (d x + c\right ) + 6 \, {\left ({\left (4 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, b^{2}\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \]

[In]

integrate(sec(d*x+c)^5*(a*cos(d*x+c)+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

1/48*(3*(4*a^2 - b^2)*cos(d*x + c)^4*log(sin(d*x + c) + 1) - 3*(4*a^2 - b^2)*cos(d*x + c)^4*log(-sin(d*x + c)
+ 1) + 32*a*b*cos(d*x + c) + 6*((4*a^2 - b^2)*cos(d*x + c)^2 + 2*b^2)*sin(d*x + c))/(d*cos(d*x + c)^4)

Sympy [F(-1)]

Timed out. \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\text {Timed out} \]

[In]

integrate(sec(d*x+c)**5*(a*cos(d*x+c)+b*sin(d*x+c))**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.08 \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {3 \, b^{2} {\left (\frac {2 \, {\left (\sin \left (d x + c\right )^{3} + \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + \frac {32 \, a b}{\cos \left (d x + c\right )^{3}}}{48 \, d} \]

[In]

integrate(sec(d*x+c)^5*(a*cos(d*x+c)+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

1/48*(3*b^2*(2*(sin(d*x + c)^3 + sin(d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) - log(sin(d*x + c) + 1)
 + log(sin(d*x + c) - 1)) - 12*a^2*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x
+ c) - 1)) + 32*a*b/cos(d*x + c)^3)/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 249 vs. \(2 (108) = 216\).

Time = 0.33 (sec) , antiderivative size = 249, normalized size of antiderivative = 2.08 \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {3 \, {\left (4 \, a^{2} - b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (4 \, a^{2} - b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 48 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 21 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 48 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 21 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 16 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 16 \, a b\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \]

[In]

integrate(sec(d*x+c)^5*(a*cos(d*x+c)+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/24*(3*(4*a^2 - b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 3*(4*a^2 - b^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1))
+ 2*(12*a^2*tan(1/2*d*x + 1/2*c)^7 + 3*b^2*tan(1/2*d*x + 1/2*c)^7 - 48*a*b*tan(1/2*d*x + 1/2*c)^6 - 12*a^2*tan
(1/2*d*x + 1/2*c)^5 + 21*b^2*tan(1/2*d*x + 1/2*c)^5 + 48*a*b*tan(1/2*d*x + 1/2*c)^4 - 12*a^2*tan(1/2*d*x + 1/2
*c)^3 + 21*b^2*tan(1/2*d*x + 1/2*c)^3 - 16*a*b*tan(1/2*d*x + 1/2*c)^2 + 12*a^2*tan(1/2*d*x + 1/2*c) + 3*b^2*ta
n(1/2*d*x + 1/2*c) + 16*a*b)/(tan(1/2*d*x + 1/2*c)^2 - 1)^4)/d

Mupad [B] (verification not implemented)

Time = 24.79 (sec) , antiderivative size = 216, normalized size of antiderivative = 1.80 \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {\left (a^2+\frac {b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (\frac {7\,b^2}{4}-a^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (\frac {7\,b^2}{4}-a^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-\frac {4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+\left (a^2+\frac {b^2}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {4\,a\,b}{3}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a^2-\frac {b^2}{4}\right )}{d} \]

[In]

int((a*cos(c + d*x) + b*sin(c + d*x))^2/cos(c + d*x)^5,x)

[Out]

((4*a*b)/3 + tan(c/2 + (d*x)/2)*(a^2 + b^2/4) + tan(c/2 + (d*x)/2)^7*(a^2 + b^2/4) - tan(c/2 + (d*x)/2)^3*(a^2
 - (7*b^2)/4) - tan(c/2 + (d*x)/2)^5*(a^2 - (7*b^2)/4) - (4*a*b*tan(c/2 + (d*x)/2)^2)/3 + 4*a*b*tan(c/2 + (d*x
)/2)^4 - 4*a*b*tan(c/2 + (d*x)/2)^6)/(d*(6*tan(c/2 + (d*x)/2)^4 - 4*tan(c/2 + (d*x)/2)^2 - 4*tan(c/2 + (d*x)/2
)^6 + tan(c/2 + (d*x)/2)^8 + 1)) + (atanh(tan(c/2 + (d*x)/2))*(a^2 - b^2/4))/d